package com.yhy.wxzn.wms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yhy.wxzn.wms.entity.WmsInboundDetail;
import com.yhy.wxzn.wms.entity.WmsOutboundConfig;
import com.yhy.wxzn.wms.entity.WmsOutboundDetail;
import com.yhy.wxzn.wms.mapper.WmsOutboundConfigMapper;
import com.yhy.wxzn.wms.service.IWmsOutboundConfigService;
import com.yhy.wxzn.wms.service.IWmsOutboundDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 出库配置
 * @Author: jeecg-boot
 * @Date:   2023-11-08
 * @Version: V1.0
 */
@Service
public class WmsOutboundConfigServiceImpl extends ServiceImpl<WmsOutboundConfigMapper, WmsOutboundConfig> implements IWmsOutboundConfigService {

    @Autowired
    private IWmsOutboundDetailService outboundDetailService;

    @Override
    public void removeInboundConfigBatch(List<String> outboundIds) {
        LambdaQueryWrapper<WmsOutboundDetail> wrapper = new LambdaQueryWrapper<>();
        wrapper.in(WmsOutboundDetail::getOutboundId,outboundIds);
        outboundDetailService.remove(wrapper);
        this.removeByIds(outboundIds);
    }
}
